# eric7.SystemUtilities.PythonUtilities

Module implementing Python related utility functions.

### Global Attributes

None

### Classes

None

### Functions

__searchInterpreters_Linux | Function to determine a list of all Python interpreters available via the executable search path (i.e.
__searchInterpreters_Windows | Function to determine a list of all Python interpreters available via the executable search path (i.e.
getExePath |
getPythonExecutable | Function to determine the path of the (non-windowed) Python executable.
getPythonInterpreterVersion | Function to determine the exact version of a given Python interpreter.
getPythonLibPath | Function to determine the path to Python's library.
getPythonLibraryDirectory | Function to determine the path to Python's library directory.
getPythonScriptsDirectory | Function to determine the path to Python's scripts directory.
getPythonVersion | Function to get the Python version (major, minor) as an integer value.
isPythonSource | Function to check for a Python source code file.
searchInterpreters | Function to determine a list of all Python interpreters available via the executable search path (i.e.

## __searchInterpreters_Linux

__searchInterpreters_Linux(environments=None)

Function to determine a list of all Python interpreters available via the executable search path (i.e. PATH) (non Windows variant).

environments (list of str (optional))
  list of environment directories to scan for Python interpreters (defaults to None)

Return:
  list of found interpreter executables

Return Type:
  list of str

Up

## __searchInterpreters_Windows

__searchInterpreters_Windows(environments=None)

Function to determine a list of all Python interpreters available via the executable search path (i.e. PATH) (Windows variant).

environments (list of str (optional))
  list of environment directories to scan for Python interpreters (defaults to None)

Return:
  list of found interpreter executables

Return Type:
  list of str

Up

## getExePath

getExePath(branch, access, versionStr)
Up

## getPythonExecutable

getPythonExecutable()

Function to determine the path of the (non-windowed) Python executable.

Return:
  path of the Python executable

Return Type:
  str

Up

## getPythonInterpreterVersion

getPythonInterpreterVersion(interpreter)

Function to determine the exact version of a given Python interpreter.

interpreter (str)
  path of the Python interpreter binary

Return:
  version of the Python interpreter

Return Type:
  str

Up

## getPythonLibPath

getPythonLibPath()

Function to determine the path to Python's library.

Return:
  path to the Python library

Return Type:
  str

Up

## getPythonLibraryDirectory

getPythonLibraryDirectory()

Function to determine the path to Python's library directory.

Return:
  path to the Python library directory

Return Type:
  str

Up

## getPythonScriptsDirectory

getPythonScriptsDirectory()

Function to determine the path to Python's scripts directory.

Return:
  path to the Python scripts directory

Return Type:
  str

Up

## getPythonVersion

getPythonVersion()

Function to get the Python version (major, minor) as an integer value.

Return:
  integer representing major and minor version number

Return Type:
  int

Up

## isPythonSource

isPythonSource(filename, source, editor=None)

Function to check for a Python source code file.

filename (str)
  name of the file with extension
source (str)
  of the file
editor (Editor (optional))
  reference to the editor, if the file is opened already (defaults to None)

Return:
  flag indicating Python source code

Return Type:
  bool

Up

## searchInterpreters

searchInterpreters(environments=None)

Function to determine a list of all Python interpreters available via the executable search path (i.e. PATH) (Windows variant).

environments (list of str (optional))
  list of environment directories to scan for Python interpreters (defaults to None)

Return:
  list of found interpreter executables

Return Type:
  list of str

Up